package nowcoder.day_48.day13;

import java.util.Scanner;

public class Num1 {
    public static void main(String []args){
        Scanner in = new Scanner(System.in);
        String str = in.nextLine();
        StringBuilder sb = new StringBuilder();
        int flag = 1;
        int len = 0;
        for(int i = 0 ; i < str.length() ; i++){
            char ch = str.charAt(i);
            if(ch == '\"'){
                flag = -flag;
                continue;
            }
            if (ch != ' '){
                sb.append(ch);
            }else if (flag == 1){
                sb.append('\n');
                len++;
            }else {
                sb.append(' ');
            }
        }
        System.out.println(len + 1);
        System.out.println(sb.toString());
    }
}